<dl class="title">
  <dt>相关分类</dt>
</dl>
<ul class="nav nav-pills nav-stacked">
  <?php
  $c_parent = $channel['c_ifsub'] ? $channel['id'] : $channel['c_parent'];
  $sidenav = $GLOBALS['db']->getAll("SELECT * FROM channel WHERE c_parent = $c_parent AND c_navigation = 1 ORDER BY c_order ASC, id ASC");
  foreach ($sidenav as $val) {
    echo '<li role="presentation" class="' . ($channel['id'] == $val['id'] ? 'active' : '') . '"><a href="' . c_url($val['id'], $val['c_link']) . '">' . $val['c_name'] . '</a></li>';
  }
  ?>
</ul>